#ifndef SEGMENTER_HPP
#define SEGMENTER_HPP

#include "HandInterface.hpp"
#include <cv.h>

class Segmenter {
public:
	Segmenter( cv::Ptr< AbstractProbabilityTransformer > probTrans );
	void segment( cv::Mat& handImg, cv::Rect& forbiddenRect ); //input img should be in BGR
	void segment( cv::Mat& handImg ); //input img should be in BGR
	bool didSegmentation();
	bool inForeground( int x, int y );
	
	cv::Mat& getContourImage(); //For use as mask in some methods
protected:
	cv::Ptr< AbstractProbabilityTransformer > probTransPtr;
	cv::Mat contour;
	bool hasSegmentation;
	void getThresholdedBackProj( cv::Mat& handImg, cv::Mat& bpThreshed );
	bool drawBPContours( cv::Mat& bpThreshed );
};

#endif